<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/


//Route::get('/', function(){});
//Route::get('/test', "CrawlerController@index");
//Route::get('/welcome', function () {
//    return view('welcome');
//});

Route::group(['middleware' => 'mock.user'], function () {//这个中间件可以先忽略，我们稍后再说
    Route::middleware('wechat.oauth:snsapi_base')->group(function () {
        Route::get('/login', 'SelfAuthController@autoLogin')->name('login');
    });
    Route::get('/register', 'SelfAuthController@autoRegister')->name('register');
    Route::middleware(['wechat.oauth:snsapi_userinfo'])->group(function () {
        Route::get('/wechat_register', 'SelfAuthController@register')->name('wechat_register');
    });
});
Route::any('/wechat', 'WeChatController@serve');
Route::any('/test','TestController@index');